const moduleInfo = module.info;

const content = {
  listener: null,
  process: {
    nodes: [
      {
        id: 'startEvent_1',
        name: 'Drafting',
        type: 'startEventAtom',
        options: {
          atom: {
            module: moduleInfo.relativeName,
            atomClassName: 'document',
          },
          conditionExpression: null,
          task: {
            atomState: 1, // state: drafting
            allowViewWorkflow: false,
          },
        },
      },
      {
        id: 'activity_1',
        name: 'Review',
        type: 'activityUserTask',
        options: {
          atomState: 2,
          assignees: {
            roles: 'superuser',
          },
          confirmation: false,
          bidding: true,
          schema: {
            write: {
              module: 'a-cms',
              schema: 'article',
            },
          },
        },
      },
      {
        id: 'endEvent_1',
        name: 'End',
        type: 'endEventAtom',
        options: {},
      },
    ],
    edges: [
      {
        id: 'edge_1',
        source: 'startEvent_1',
        target: 'activity_1',
      },
      {
        id: 'edge_2',
        source: 'activity_1',
        target: 'endEvent_1',
      },
    ],
  },
};
const definition = {
  atomName: 'CMS Document Publish',
  atomStaticKey: 'flowDocumentPublish',
  atomRevision: 120,
  description: '',
  content: JSON.stringify(content),
};
module.exports = definition;
